package com.bsoft.consumer;

import com.bsoft.message.Demo07Message;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
@Slf4j
@Component
@RabbitListener(queues = Demo07Message.QUEUE)
public class Demo07Consumer {
    @RabbitHandler
    public void  onMessage(Demo07Message message){
        log.info("[onMessage][线程编号:{} 消息内容：{}]", Thread.currentThread().getId(), message);
        // 此处抛出一个RuntimeExection 异常 模拟消息失败

    }


}
